<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .box{
            position: relative;
            width: 200px;
            height: 40px;
            line-height: 40px;
            border-radius:20px;
            padding: 0 10px;
            overflow: hidden;
            background-color: #6d3617;
            overflow: -webkit-marquee;
            -webkit-marquee-direction: forwards;
            -webkit-marquee-speed: slow;
            -webkit-marquee-style: alternate;
        }
        .text {
            /* position: absolute;
            top: 0;
            left: 0; */
            display: inline-block;
            width: auto;
            height: 100%;
            /* display: flex;
            align-items: center;
            justify-content: left; */
            color: #fff;
            white-space: nowrap;
        }
        .marquee {
            /* animation: marquee 5s linear infinite alternate; */
            /* white-space: nowrap;
            overflow: -webkit-marquee;
            -webkit-marquee-direction: forwards;
            -webkit-marquee-speed: slow;
            -webkit-marquee-style: alternate; */

        }
        @keyframes marquee {
            0%{
                /* left: 0;
                right: auto; */
                transform: translateX(0%);
            }
            50%{
                /* left: -50%;
                right: auto; */
            }
            75%{
                /* left: -75%;
                right: auto; */
            }
            90%{
                /* left: -90%;
                right: auto; */
            }
            100%{
                /* left: auto;
                right: 0; */
                transform: translateX(-66%);
            }
        }
    </style>
    <div class="box">
        <div class="text marquee">
            A long text long text long text long text long text long text long text B
        </div>
    </div>
</body>
</html>